/*
* Copyright 2018 Shanxi Lu'an Taihang Laihui Net Tech co.,LTD.
*/
package com.laihuichuxing.bus.dao;

import com.laihuichuxing.order.bus.entity.BusOrderEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * Description:
 *
 * @author: Qinxuefeng
 * @since: 1.0
 * Create Date Time: 2018/12/11 10:05
 * Update Date Time:
 */
public interface BusOrderDao {
    /** 
     * Description: 新增sql
     * @param  
     * @return  
     * @author QinXueFeng
     * Create Date Time: 2018/12/11 10:06
     * Update Date Time:
     */

    int createBySql(@Param("sqlStr") String sqlStr);

    /**
     * Description: 查询未支付订单
     * Author: Qinxuefeng
     * Version: 1.0
     * Create Date Time: 2018/8/13 17:16.
     * Update Date Time:
     */
    List<Map<String,Object>> getPassengerByToken(@Param("token") String token, @Param("orderNumber") String orderNumber, @Param("status") String status);
    /**
     * Description: 查询未支付订单
     * Author: Qinxuefeng
     * Version: 1.0
     * Create Date Time: 2018/8/13 17:16.
     * Update Date Time:
     */
    List<Map<String,Object>> getPassengerByTokenLimit(@Param("token") String token,@Param("orderNumber") String orderNumber,@Param("status") String status,
                                                      @Param("pageNo") String pageNo,@Param("pageSize") String pageSize);
    /**
     * Description: 查询订单用于下单
     * Author: Qinxuefeng
     * Version: 1.0
     * Create Date Time: 2018/8/15 10:15.
     * Update Date Time:
     */
    Map<String,Object> getOrderByOderNumber(@Param("orderNumber") String orderNumber);
    /**
     * Description: 查询未支付订单用于下单
     * Author: Qinxuefeng
     * Version: 1.0
     * Create Date Time: 2018/8/13 17:02.
     * Update Date Time:
     */
    List<Map<String,Object>> selectOrderList(@Param("orderNumber") String orderNumber);
    /**
     * Description: 查询订单用于退款
     * Author: Qinxuefeng
     * Version: 1.0
     * Create Date Time: 2018/8/15 10:15.
     * Update Date Time:
     */
    Map<String,Object> findReOrder(@Param("orderNu") String orderNu);

    /**
     * Description:根据用户id查询用户最近行程
     * @param:  * @param userId
     * @return:  Map<String,Object>
     * @author: skye
     * Create Date Time: 2018/11/7 14:25
     * Update Date Time:
     */
    BusOrderEntity findRecentOrder(String userId);
    /** 
     * Description: 修改订单状态
     * @param  orderNumber
     * @param  status
     * @return
     * @author QinXueFeng
     * Create Date Time: 2018/12/11 15:00
     * Update Date Time:
     */ 
    int updateStatus(@Param("orderNumber")String orderNumber, @Param("status")int status);
    /**
     * Description: 修改同程订单号
     * @param  tcOrderId
     * @param  orderNumber
     * @return
     * @author QinXueFeng
     * Create Date Time: 2018/12/11 16:07
     * Update Date Time:
     */
    int updateTcOrderId(@Param("tcOrderId")String tcOrderId, @Param("orderNumber")String orderNumber);
    /** 
     * Description: 修改流水状态
     * @param  
     * @return  
     * @author QinXueFeng
     * Create Date Time: 2018/12/14 10:55
     * Update Date Time:
     */ 
    int updateSteamStatus(@Param("orderNumber")String orderNumber, @Param("status")String status);
}
